class {{classname}}

{{#parent}}
inherit
{{/parent}}


{{#parent}}
  {{{parent}}}
     {{^isPrimitiveType}}
      {{^isMap}}
      {{^isArray}}
      rename
          output as out_{{{parentSchema}}}
      end
     {{/isArray}}
     {{/isMap}}
     {{/isPrimitiveType}}
{{/parent}}

feature --Access

{{#vars}}
    {{^isInherited}}
    {{#isPrimitiveType}}
    {{^isContainer}}
    {{name}}: {{{dataType}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{#isPrimitiveType}}
    {{#isContainer}}
    {{name}}: detachable {{{datatypeWithEnum}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{^isPrimitiveType}}
    {{#isContainer}}
    {{name}}: detachable {{{datatypeWithEnum}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{^isContainer}}
    {{name}}: detachable {{{dataType}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{/isInherited}}
{{/vars}}

feature -- Change Element

  {{#vars}}
    {{^isInherited}}
    set_{{name}} (a_name: like {{name}})
        -- Set '{{name}}' with 'a_name'.
      do
        {{name}} := a_name
      ensure
        {{name}}_set: {{name}} = a_name
      end

    {{/isInherited}}
  {{/vars}}

 feature -- Status Report

    output: STRING
          -- <Precursor>
      do
        create Result.make_empty
        {{#parent}}
        Result.append(out_{{{parentSchema}}})
        {{/parent}}
        Result.append("%Nclass {{classname}}%N")
        {{#vars}}
        {{^isInherited}}
        {{#isArray}}
        if attached {{name}} as l_{{name}} then
          across l_{{name}} as ic loop
            Result.append ("%N {{name}}:")
            Result.append (ic.item.out)
            Result.append ("%N")
          end
        end
        {{/isArray}}
        {{#isMap}}
        if attached {{name}} as l_{{name}} then
          Result.append ("%N{{name}}:")
          across l_{{name}} as ic loop
            Result.append ("%N")
            Result.append ("key:")
            Result.append (ic.key.out)
            Result.append (" - ")
            Result.append ("val:")
            Result.append (ic.item.out)
            Result.append ("%N")
          end
        end
        {{/isMap}}
        {{^isContainer}}
        if attached {{name}} as l_{{name}} then
          Result.append ("%N{{name}}:")
          Result.append (l_{{name}}.out)
          Result.append ("%N")
        end
        {{/isContainer}}
        {{/isInherited}}
        {{/vars}}
      end
end
